<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>

  <div class="container-fluid ms-container has-ms-sidemenu">

    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">公司信息管理</li>
      <a href="javascript:window.history.back();" class="pull-right" style="margin: 0 10px;">
        <span class="glyphicon glyphicon-arrow-left"></span>&nbsp;返回
      </a>
    </ol>

    <div class="ms-content-layout">

      <%@ include file="/WEB-INF/jsps/supplier/profile/profile-view-fragment/supplier-status-fragment.jsp"%>

      <%@ include file="/WEB-INF/jsps/supplier/profile/profile-view-fragment/supplier-info-fragment.jsp"%>

      <%@ include file="/WEB-INF/jsps/supplier/profile/profile-view-fragment/supplier-certificate-fragment.jsp"%>

      <div id="anchor-ware-supplier" class="block-heading">
        <h5>仓储供方资源信息</h5>
        <c:if test="${supplierMenuType != 'sub'}">
          <a href="${ctx.host}/suppliers/${supplier.id}/ware-supplier/edit?panel=true" data-target="#edit" data-toggle="modal" title="Edit" class="pull-right" style="font-size: 12px; padding-top: 20px;">编辑</a>
        </c:if>
      </div>

      <div class="form-horizontal ms-form form-personal-info form-supplier-info">

        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">25&nbsp;参与运作仓库：
          </label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${selection.wareHourseDesc(wareSupplier.operationWarehouse)}</p>
          </div>

          <label class="control-label col-xs-3 ">26&nbsp;参与运作码头：
          </label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${wareSupplier.operationDockDesc}</p>
          </div>
        </div>

        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">27&nbsp;参与运作站台：
          </label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${wareSupplier.operationPlatformDesc}</p>
          </div>

          <label class="control-label col-xs-3 ">28&nbsp;<span class="color-red">*</span>仓储类型：
          </label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${wareSupplier.wareType.description}</p>
          </div>
        </div>

        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">29&nbsp;维修资质：</label>
          <div class="col-xs-3 pull-left">

            <p class="form-control-static">
              <c:choose>
                <c:when test="${empty wareSupplier.maintenanceQualification and param.supplierMenuType == 'sub'}">暂未上传</c:when>
                <c:when test="${not empty wareSupplier.maintenanceQualification and param.supplierMenuType == 'sub'}">
                  <a href="${wareSupplier.maintenanceQualification}" download="${supplier.name}维修资质">维修资质</a>
                </c:when>
                <c:when test="${empty wareSupplier.maintenanceQualification and param.supplierMenuType != 'sub'}">
                  暂未上传，点击按钮上传
                  <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplierId}/ware-supplier/upload?type=maintenanceQualification&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">上传</a>
                </c:when>
                <c:otherwise>
                  <a href="${wareSupplier.maintenanceQualification}" download="${supplier.name}维修资质">维修资质</a>
                  <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplierId}/ware-supplier/upload?type=maintenanceQualification&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
                </c:otherwise>
              </c:choose>
            </p>

          </div>
        </div>

        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3 ">30&nbsp;<span class="color-red">*</span>现场人员清单：
          </label>
          <div class="col-xs-3 pull-left upload-cover">
            <p class="form-control-static">
              <c:choose>
                <c:when test="${empty wareSupplier.onsiteStaffList and supplierMenuType == 'sub'}">暂未上传</c:when>
                <c:when test="${not empty wareSupplier.onsiteStaffList and supplierMenuType == 'sub'}">
                  <a href="${wareSupplier.onsiteStaffList}" download="${supplier.name}现场人员清单">现场人员清单</a>
                </c:when>
                <c:when test="${empty wareSupplier.onsiteStaffList and supplierMenuType != 'sub'}">
                    暂未上传，点击按钮上传
                    <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplierId}/ware-supplier/upload?type=onsiteStaffList&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">上传</a>
                </c:when>
                <c:otherwise>
                  <a href="${wareSupplier.onsiteStaffList}" download="${supplier.name}现场人员清单">现场人员清单</a>
                  <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplierId}/ware-supplier/upload?type=onsiteStaffList&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
                </c:otherwise>
              </c:choose>
            </p>
          </div>
        </div>

        <c:if test="${wareSupplier.wareType.code eq 'commodity' }">
          <div class="form-group  ms-form-group">
            <label class="control-label col-xs-3 ">31&nbsp;<span class="color-red">*</span>商检许可证原件：
            </label>
            <div class="col-xs-3 pull-left upload-cover">
              <p class="form-control-static">
                <c:choose>
                  <c:when test="${empty wareSupplier.inspectionPermit and supplierMenuType == 'sub'}">暂未上传</c:when>
                  <c:when test="${not empty wareSupplier.inspectionPermit and supplierMenuType == 'sub'}">
                    <a href="${wareSupplier.inspectionPermit}" download="${supplier.name}商检许可证原件">商检许可证原件</a>
                  </c:when>
                  <c:when test="${empty wareSupplier.inspectionPermit and supplierMenuType != 'sub'}">
                    暂未上传，点击按钮上传
                     <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplierId}/ware-supplier/upload?type=inspectionPermit&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">上传</a>
                  </c:when>
                  <c:otherwise>
                    <a href="${wareSupplier.inspectionPermit}" download="${supplier.name}商检许可证原件">商检许可证原件</a>
                    <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplierId}/ware-supplier/upload?type=inspectionPermit&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
                  </c:otherwise>
                </c:choose>
              </p>
            </div>
          </div>
        </c:if>
      </div>

      <jsp:include page="/WEB-INF/jsps/supplier/profile/profile-view-fragment/business-history-fragment.jsp">
        <jsp:param name="type" value="ware" />
      </jsp:include>

      <%@ include file="/WEB-INF/jsps/supplier/profile/profile-view-fragment/parking-resource-fragment.jsp"%>

      <%@ include file="/WEB-INF/jsps/supplier/profile/profile-view-fragment/supplier-staff-fragment.jsp"%>

      <div id="anchor-ware-supplier-employee" class="block-heading">
        <h5>现场人员总数</h5>
      </div>

      <table class="table table-hover ms-table ">
        <thead>
          <tr>
            <c:forEach items="${enums['WareSiteEmployee']}" var="wareSiteEmployee" varStatus="count">
              <th>${wareSiteEmployee.description}</th>
              <c:set var="count" value="${count.index+1 }" />
            </c:forEach>
            <th>合计</th>
            <c:if test="${supplierMenuType != 'sub'}">
              <th>操作</th>
            </c:if>
          </tr>
        </thead>
        <tbody>
          <tr>
            <c:set var="display" value="false" />
            <c:forEach items="${wareSupplierEmployees}" var="wareSupplierEmployee">
              <c:set var="sum" value="${sum+wareSupplierEmployee.value}" />
              <td>${empty wareSupplierEmployee.value ? '0':wareSupplierEmployee.value}</td>
              <c:set var="display" value="true" />
            </c:forEach>

            <c:if test="${not display }">
              <td>无</td>
              <td>无</td>
              <td>无</td>
              <td>无</td>
              <td>无</td>
              <td>无</td>
              <td>无</td>
              <td>无</td>
              <td>无</td>
              <td>无</td>
              <td>无</td>
            </c:if>
            <td>${empty sum ? '0':sum}</td>
            <c:set var="sum" value="0" />
            <c:if test="${supplierMenuType != 'sub'}">
              <td><a href="${ctx.host}/suppliers/${supplier.id}/ware-supplier-employee/${not display? 'create':'edit'}?panel=true" data-target="#edit" data-toggle="modal">${not display? '新建':'编辑'}</a>&nbsp;&nbsp;</td>
            </c:if>
          </tr>
        </tbody>
      </table>

      <%@include file="profile-view-fragment/supplier-payment-info-fragment.jsp" %>


      <div class="block-heading">
        <h5>申请人上传部分(管理公司)</h5>
      </div>

      <div class="form-horizontal ms-form form-personal-info">

        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">32&nbsp;<span class="color-red">*</span>备选供应商引入评审上传：
          </label>
          <div class="col-xs-8 pull-left upload-cover">
            <c:choose>
              <c:when test="${empty recommendation.introduceForm and supplierMenuType == 'sub'}">暂未上传</c:when>
              <c:when test="${not empty recommendation.introduceForm and supplierMenuType == 'sub'}">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${recommendation.introduceForm}" download="备选供应商引入评审">备选供应商引入评审</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=introduceForm&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
              </c:when>
              <c:when test="${empty recommendation.introduceForm and supplierMenuType != 'sub'}">
           暂未上传，点击按钮上传
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=introduceForm&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">上传</a>
              </c:when>
              <c:otherwise>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${recommendation.introduceForm}" download="备选供应商引入评审">备选供应商引入评审</a>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=introduceForm&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
              </c:otherwise>
            </c:choose>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${ctx.resource}/template/supplier/supplier-introduce-form.docx" download="“备选”物流供应商引入评审申报表">备选供应商引入评审模板</a>
          </div>
        </div>

        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">33&nbsp;<span class="color-red">*</span>现场评审得分结果上传：</label>
          <div class="col-xs-8 pull-left upload-cover">
            <c:choose>
              <c:when test="${empty recommendation.assessment and supplierMenuType == 'sub'}">暂未上传</c:when>
              <c:when test="${not empty recommendation.assessment and supplierMenuType == 'sub'}">
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${recommendation.assessment}" download="现场评审得分结果">现场评审得分结果</a>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=assessment&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
              </c:when>
              <c:when test="${empty recommendation.assessment and supplierMenuType != 'sub'}">
           暂未上传，点击按钮上传
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=assessment&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">上传</a>
              </c:when>
              <c:otherwise>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${recommendation.assessment}" download="现场评审得分结果">现场评审得分结果</a>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=assessment&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
              </c:otherwise>
            </c:choose>
            
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="${ctx.resource}/template/supplier/supplier-assessment.xls" download="现场评审得分结果模板-仓储">现场评审得分结果模板</a>
          </div>
        </div>

        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">34&nbsp;<span class="color-red">*</span>推荐函上传：
          </label>
          <div class="col-xs-8 pull-left upload-cover">
            <c:choose>
              <c:when test="${empty recommendation.recommendation and supplierMenuType == 'sub'}">暂未上传</c:when>
              <c:when test="${not empty recommendation.recommendation and supplierMenuType == 'sub'}">
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${recommendation.recommendation}" download="推荐函">推荐函</a>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=recommendation&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
              </c:when>
              <c:when test="${empty recommendation.recommendation and supplierMenuType != 'sub'}">
           暂未上传，点击按钮上传
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=recommendation&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">上传</a>
              </c:when>
              <c:otherwise>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${recommendation.recommendation}" download="推荐函">推荐函</a>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=recommendation&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
              </c:otherwise>
            </c:choose>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="${ctx.resource}/template/supplier/supplier-vehicle-recommendation.docx" download="整车物流供应商推荐说明">推荐函模板</a>
          </div>
        </div>
    
      </div>
      
    </div>
  </div>
  
  <!-- 打印页面 -->
  <%@ include file="/WEB-INF/jsps/supplier/profile/profile-view-fragment/supplier-profile-storage-fragment.jsp"%>

  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/supplier/management/supplier-info-view.js" />
  <script type="text/javascript">
    require(['page/supplier/management/supplier-info-view'], function (page) {
        page.init()
    })
</script>

</body>
</html>